package svgedit.gui.actions;

import java.awt.Cursor;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.AbstractAction;

import svgedit.gui.Frame;
import svgedit.gui.actions.ViewListener.ShapeType;

/**
 * Prepares the mouse listener for inserting a shape
 * 
 * @author SARJ
 * 
 */
public class InsertCircleAction extends AbstractAction implements
		ActionListener
{
	private static final long serialVersionUID = -5175805965856195532L;

	/**
	 * Constructs a new Insert Circle
	 */
	public InsertCircleAction()
	{
		super("Circle");
	}

	/**
	 * Prepares the mouse listener for inserting a circle
	 */
	@Override
	public void actionPerformed(ActionEvent e)
	{
		Frame.getFrame().getView().getViewListener()
				.setShapeType(ShapeType.CIRCLE);
		Frame f = Frame.getFrame();
		f.modifiedTitle(true);

		// Change mouse cursor
		Cursor crossCursor = new Cursor(Cursor.CROSSHAIR_CURSOR);
		Frame.getFrame().getView().setCursor(crossCursor);

	}

}
